#pragma once
#include "Character/Creature.h"
#include "Common/TableData/ThingCollectCfg.h"
//#include "Common/DeputyDefine.h"
#include "Common/CollectDefine.h"

class Object : public Creature
{
public:
	Object();
	virtual ~Object(){}

public:
	virtual bool CheckAttrValue(uint32_t CANum, uint32_t attrValue) { return true; }
	virtual bool AddAttr(uint32_t CANum, int64_t attrValue, bool syn, uint64_t relationCid = 0) { return true; }
	virtual bool AddAttrCache(uint32_t CANum, int64_t attrValue, uint64_t relationCid = 0) { return true; }
	virtual void SetAttr(uint32_t CANum, int64_t attrValue, bool syn = false) {}
	virtual void SetAttrCache(uint32_t CANum, int64_t attrValue) {}

	virtual int64_t GetAttr(uint32_t CANum) { return 0; }
	virtual uint32_t GetAttrNum(uint32_t CommonAttrNum) { return 0; }
	virtual uint32_t GetConfigId(){ return m_objectId; }
	virtual int32_t GetPosIdx(){ return m_posIdx; }

public:
	virtual bool Init(){ return true; }
	virtual bool UnInit();
	virtual void Update(uint64_t tick);
	virtual void OnDead(CharIDType killerCid) {}
	virtual void GetVisibleDataToClient(CreaturesCreateData& cvData);
	virtual bool Born(CharIDType nObjectCid, uint32_t nObjectId, uint32_t sceneId, Point3<float>& bornPos, int32_t posIdx);
	virtual bool PlayerCanSeen(CharIDType charId);
	const ThingCollectCfgInfo *GetObjectCfg() { return m_pObjectCfg; };

public:
	void				SetCount(uint32_t count);
	uint32_t			GetCount()	{ return m_count; }
	CollectData_Type	GetType()	{ return m_type; }
	uint64_t			GetSeenCharId() { return m_canSeenId; }
	void				SetSeenCharId(uint64_t charId) { m_canSeenId = charId; }
private:
	uint32_t m_objectId;			//配置ID
	int32_t m_posIdx;				//位置
	uint32_t m_count;				//剩余采集次数
	uint64_t m_canSeenId;			//对谁可见
	CollectData_Type m_type;		//采集物件类型
	const ThingCollectCfgInfo *m_pObjectCfg;
};